print("LUA console over wifi.=======================")
print("Author: openthings@163.com. copyright&GPL V2.")
print("Last modified 2014-11-18.")
print("Starting TCP Server at 8080...")

tmr.delay(5000)
print(wifi.sta.getip())

sv=net.createServer(net.TCP, false)
sv:listen(8080,
	function(conn)
		conn:on("receive", 
			function(sck, pl)
				print(pl) 
				result = pcall(loadstring(pl))
				--print(strData)
				
				conn:send("RECEIVED:")
				conn:send(pl)
				--conn:on("sent",function(conn) conn:close() end)
			end
		)
		conn:send("REC:")
		--conn:send(strData)
	end
)

print("TCPServer running at :8080")
print("Please input LUA now.")


